package com.sannuo.detector.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sannuo.common.domain.DrugStore;
import com.sannuo.common.domain.Patient;
import com.sannuo.common.domain.vo.PatientAndStoreVo;
import com.sannuo.detector.dao.PatientMapper;
import com.sannuo.detector.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class PatientServiceImpl extends ServiceImpl<PatientMapper, Patient> implements PatientService {
    @Autowired
    private PatientMapper patientMapper;

    @Override
    public List<Patient> findAll(PatientAndStoreVo patientAndStore) {
        return patientMapper.findAll(patientAndStore);
    }

    @Override
    public List<DrugStore> findAllBranchStore() {
        return patientMapper.findAllBranchStore();
    }

    @Override
    public int addPatient(Patient patient) {
        return patientMapper.addPatient(patient);
    }

    @Override
    public int updatePatient(Patient patient) {
        return patientMapper.updatePatient(patient);
    }

    @Override
    public int updatePatient2(Integer patientId) {
        return patientMapper.updatePatient2(patientId);
    }
}
